﻿using STHPMS1.ICore.I_Entity.Info;
using STHPMS1.ICore.I_Entity.Stmpms1;
using STHPMS1.ICore.I_Serv;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace STHPMS1.ICore.I_BLL.Bus
{
    public interface IB_HistoryBll : IBll
    {
        void UpdatePreventModel(string rdwayid, double beginmp, double endmp, int direct, string measure);
        /// <summary>
        /// 验证路线指定方向的结构层表是否存在该类型的层位
        /// </summary>
        /// <param name="rdId"></param>
        /// <param name="dir"></param>
        /// <param name="layerDictid"></param>
        /// <returns></returns>
       bool ExistsLayer(string rdId,int dir,int layerDictid);
        /// <summary>
        /// 添加养护记录
        /// </summary>
        /// <param name="h_ds"></param>
        /// <param name="h_l_ds"></param>
        void AddHistory(IB_History_Details h_ds, IB_History_Layer_Details[] h_l_ds);
        /// <summary>
        /// 更新路面结构和层
        /// </summary>
        /// <param name="oldStruid"></param>
        /// <param name="lstPms"></param>
        /// <param name="lstLayer"></param>
        void UpdateHistory(string oldStruid, IB_Pmstc[] lstPms, IB_Layer[] lstLayer);
        /// <summary>
        /// 更新路面结构和层
        /// </summary>
        /// <param name="p"></param>
        /// <param name="lstLayer"></param>
        void UpdateXTHistroy(IB_Pmstc p, IB_Layer[] lstLayer);
        /// <summary>
        /// 查询路面结构对应的层
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="struid"></param>
        /// <returns></returns>
        IEnumerable<T> GetLayer<T>(string struid) where T : class,IB_Layer;
        /// <summary>
        /// 创建一个新拆分的路面结构
        /// </summary>
        /// <param name="oldStruid"></param>
        /// <param name="p"></param>
        void AddNewData(string oldStruid, IB_Pmstc p);
        /// <summary>
        /// 移动旧的路面结构和层
        /// </summary>
        /// <param name="oldStruid"></param>
       void MoveOldData(string oldStruid);
        /// <summary>
        /// 修改路面结构的终点桩号
        /// </summary>
        /// <param name="struid"></param>
        /// <param name="endmp"></param>
        void UpdateEndmp(string struid, double endmp);
        /// <summary>
        /// 修改路面结构的ID和起点桩号
        /// </summary>
        /// <param name="oldStruid">旧路面结构ID</param>
        /// <param name="newStruid">新路面结构ID</param>
        /// <param name="mp">桩号值</param>
        void UpdateHistory(string oldStruid, string newStruid,  double mp);
       

        IEnumerable<T> Get<T>(Expression<Func<T, bool>> predicate, IPagingInfo info)
            where T : class, IB_History_Details;

        /// <summary>
        /// 根据线路和方向查询路面结构，并根据终点桩号排序
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="rdid"></param>
        /// <param name="dir"></param>
        /// <returns></returns>
        IEnumerable<T> GetPMSTC<T>(string rdid, int dir) where T : class, IB_Pmstc;

        /// <summary>
        /// 养护明细
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="info"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        IEnumerable<T> GetDetails<T>(Expression<Func<T, bool>> predicate, IPagingInfo info, string id) where T : class, IB_History_Layer_Details;
    }
}
